﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPageUser.master" AutoEventWireup="true" CodeFile="Payment.aspx.cs" Inherits="Payment" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<title>Payment</title>
    <style type="text/css">
        .style1
        {
            width: 131px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <asp:DataList ID="DataList1" runat="server" DataKeyField="PolicyId" 
        DataSourceID="SqlDataSource1" Width="395px" CellPadding="4" 
        ForeColor="#333333" onitemdatabound="DataList1_ItemDataBound">
        <AlternatingItemStyle BackColor="White" />
        <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <ItemStyle BackColor="#FFFBD6" ForeColor="#333333" />
        <ItemTemplate>
            <h2><asp:Label ID="InsuranceTypeLabel" runat="server" 
                Text='<%# Eval("InsuranceType") %>' /></h2>
            <table style="width:100%;">
                <tr>
                    <td class="style1">
                        <h3>
                            PolicyId:</h3>
                    </td>
                    <td>
                        <asp:Label ID="PolicyIdLabel" runat="server" Text='<%# Eval("PolicyId") %>' />
                    </td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style1">
                        <h3>
                            Cost:</h3>
                    </td>
                    <td>
                        <asp:Label ID="CostLabel" runat="server" Text='<%# Eval("Cost") %>' />
                    </td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style1">
                        <h3>
                            Note:</h3>
                    </td>
                    <td>
                        <asp:Label ID="NoteLabel" runat="server" Text='<%# Eval("Note") %>' />
                    </td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style1">
                        <h3>
                            Create Date:</h3>
                    </td>
                    <td>
                        <asp:Label ID="DateOfCreateLabel" runat="server" 
                            Text='<%# Eval("DateOfCreate") %>' />
                    </td>
                    <td>
                        &nbsp;</td>
                </tr>
                </table>
            
            <br />
            <asp:Button ID="Button2" runat="server" oncommand="Button2_Command" 
                Text="Payment" />
            <br />
        </ItemTemplate>
        <SelectedItemStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
    </asp:DataList>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:connString %>" 
        
        SelectCommand="SELECT Policy.PolicyId, Bill.Cost, Bill.Note, Bill.DateOfCreate, Policy.UserId, Bill.IsPaid, Policy.InsuranceType, Bill.BillId FROM Bill INNER JOIN Policy ON Bill.PolicyId = Policy.PolicyId WHERE (Policy.UserId = @UserId) AND (Bill.IsPaid = 0)">
        <SelectParameters>
            <asp:SessionParameter Name="UserId" SessionField="UserId" />
        </SelectParameters>
    </asp:SqlDataSource>

</asp:Content>

